<?php
require_once("db.class.php");
class Session {
	var $dbin;
	var $name;
	var $info;
	function Session()
	{
		require_once("db.class.php");
		$this->dbin = new DB();
	}
	function Get_info($LOG){
		$this->dbin->query("select id_user as id,firstname as fn,lastname as ln, pseudo as ps,photopath as ph,mail as ml
				from user as a 
				where a.mail=\"".$LOG."\";");
		while($this->dbin->fetch_assoc())
		{
			$this->info['id_user']=$this->dbin->row['id'];	
			$this->info['firstname']=$this->dbin->row['fn'];	
			$this->info['lastname']=$this->dbin->row['ln'];
			$this->info['pseudo']=$this->dbin->row['ps'];				
			$this->info['photopath']=$this->dbin->row['ph'];
			$this->info['mail']=$this->dbin->row['ml'];			
		}
		return $this->info;	
	}
	function Get_info_id($LOG){
		$this->dbin->query("select id_user as id,firstname as fn,lastname as ln, pseudo as ps,photopath as ph,mail as ml
				from user as a 
				where a.id_user=\"".$LOG."\";");
		while($this->dbin->fetch_assoc())
		{
			$this->info['id_user']=$this->dbin->row['id'];	
			$this->info['firstname']=$this->dbin->row['fn'];	
			$this->info['lastname']=$this->dbin->row['ln'];
			$this->info['pseudo']=$this->dbin->row['ps'];				
			$this->info['photopath']=$this->dbin->row['ph'];
			$this->info['mail']=$this->dbin->row['ml'];			
		}
		return $this->info;	
	}
	function Get_firstname($LOG){
		
		$this->dbin->query("select firstname as n
				from user as a 
				where a.mail=\"".$LOG."\";");
		while($this->dbin->fetch_assoc())
		{
			$this->name=$this->dbin->row['n'];		
		}
	return $this->name;
}
	function Get_lastname($LOG){
		
		$this->dbin->query("select lastname as n
				from user as a 
				where a.mail=\"".$LOG."\";");
		while($this->dbin->fetch_assoc())
		{
			$this->name=$this->dbin->row['n'];		
		}
	return $this->name;
	}
/*
	function Get_Mobile($LOG){
		
		$this->dbin->query("select lastname as n
				from user as a 
				where a.mail=\"".$LOG."\";");
		while($this->dbin->fetch_assoc())
		{
			$this->name=$this->dbin->row['n'];		
		}
	return $this->name;
	}
*/
}
?>